// AppWrapper.tsx
import { ConfigProvider, Button } from "antd";
import { useTheme } from "./theme/themeContext";

import App from "./App";

const AppWrapper = () => {
  const { themeConfig, isDark, setIsDark } = useTheme();

  return (
    <ConfigProvider theme={themeConfig}>
      <Button onClick={() => setIsDark(!isDark)}>
        切换为 {isDark ? "亮色" : "暗黑"}模式
      </Button>
      <App />
    </ConfigProvider>
  );
};

export default AppWrapper;
